import 'package:flutter/material.dart';

class LayOutDemo extends StatelessWidget {
  const LayOutDemo({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      children: <Widget>[
        IconBadge(Icons.pool),
        IconBadge(
          Icons.pages,
          size: 48.0,
        ),
        IconBadge(Icons.undo),
        IconBadge(Icons.person),
      ],
    );
  }
}

// 徽章标签的封装
class IconBadge extends StatelessWidget {
  final IconData icon;
  final double size;
  const IconBadge(this.icon, {Key key, this.size = 32.0}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Icon(
        icon,
        size: size,
        color: Colors.white,
      ),
      width: size + 60,
      height: size + 60,
      color: Color.fromRGBO(3, 54, 255, 1.0),
    );
  }
}
